﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Basics
{
    class Scene
    {
        private ArrayList worldObjects;

        private Camera2D camera;

        public Camera2D MyProperty
        {
            get { return camera; }
            set { camera = value; }
        }

        public ArrayList WorldObjects
        {
            get { return worldObjects; }
            set { worldObjects = value; }
        }

        public Scene(Camera2D camera)
        {
            this.worldObjects = new ArrayList();
            this.camera = camera;
        }

        public void UpdateScene(GameTime gameTime)
        {

        }

        public void DrawScene(SpriteBatch spriteBatch)
        {
            foreach (DrawableObject drawableObject in worldObjects)
            {
                Vector2 orgpos = drawableObject.Position;
                drawableObject.Position += this.camera.Position;
                drawableObject.Draw(spriteBatch);
                drawableObject.Position = orgpos;
            }
        }

        public void AddObject(WorldObject worldObject)
        {
            this.worldObjects.Add(worldObject);
        }


    }
}
